<template>
    <div class="has_header">
      <Header></Header>
      <div style="padding: 0.15rem 0 0.1rem">
        <spotList :dataList="itemData01" :showAction="showAction"></spotList>
        <div class="null" v-if="itemData01.length==0"><img src="../static/img/null.png" alt=""><p>暂无数据！</p></div>
      </div>
    </div>
</template>

<script type="text/ecmascript-6">
  import Header from './comment/header/header'
  import spotList from './comment/spotList/spotList'
  export default {
    components: {Header,spotList},
    name: "listSave",
    data(){
      return{
        showAction:false,
        itemData01:[]
      }
    },
    methods:{
      toAreaDetail(){
        this.$router.push('/areaDetail')
      },
      getSave(){
        let that = this;
        that.$axios.get(this.$store.state.apiUrl+'option/getstoresite',{
          params:{
            user_id:sessionStorage.getItem('userId'),
            lang: that.$i18n.locale
          }
        })
          .then(function (res) {
          console.log(res)
            if ( res.data.status ){
              that.itemData01 = res.data.data
            }
          })
          .catch(function (error) {
            console.log('操作失败');
          });
      }
    },
    mounted(){
      if(sessionStorage.getItem('lang')==='en_us'){
        this.$store.state.detailTitle = 'my collection';
      }else {
        this.$store.state.detailTitle = '我的收藏';
      }
      this.$store.state.showTab = false;
    },
    created(){
      this.getSave();
    }
  }
</script>

<style lang="stylus" rel="stylesheet/stylus">
  .has_header
    padding-top 44px;
    height 100vh
    background #FAFAFA
  .main_scroll
    height 100%
    overflow auto
    padding-top 0.2rem
</style>
